package com.deer.wms.ware.task.web;


import com.deer.wms.project.root.core.result.Result;
import com.deer.wms.project.root.core.result.ResultGenerator;
import com.deer.wms.ware.task.model.SO.SoDetailCriteria;
import com.deer.wms.ware.task.model.SO.SoMasterCriteria;
import com.deer.wms.ware.task.model.out.OutDetail;
import com.deer.wms.ware.task.model.out.OutMasterDto;
import com.deer.wms.ware.task.service.OutDetailService;
import com.deer.wms.ware.task.service.OutMasterService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 发运单detail 前端控制器
 * </p>
 *
 * @author luowei
 * @since 2022-04-19 09:07:42
 */
@RestController
@RequestMapping("/out/detail")
public class OutDetailController {

    @Autowired
    private OutMasterService outMasterService;

    @Autowired
    private OutDetailService outDetailService;

    /**
     * 根据出库单号查询出库单明细
     * */
    @GetMapping("/list")
    public Result list(SoDetailCriteria criteria) {
        PageHelper.startPage(criteria.getPageNum(), criteria.getPageSize());
         List<OutDetail> outDetails = outDetailService.getListByField("bill_no", criteria.getBillNo());
        PageInfo pageInfo = new PageInfo(outDetails);
        return ResultGenerator.genSuccessResult(pageInfo);
    }
}

